<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/jsp/taglibs.jsp"%>
<%@taglib uri="http://www.framework.com/taglib/tree" prefix="tree"%>
<%@taglib prefix="frame" uri="http://www.framework.com/taglib"%>
<html>
  <head>
	<title>公共平台 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!-- 样式文件的引入 -->
	<link href="${ctx}/commons/css/style.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/icon.css">
	<!-- jqueryUI JS文件的引入 -->
	<script type="text/javascript" src="${ctx}/commons/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/easyui-extends-validate.js"></script>
	<!-- jqueryUI国际化 -->
	<script type="text/javascript" src="${ctx}/commons/js/easyui-lang-zh_CN.js"></script>
	<!-- 开发使用的公用js方法 -->
	<script type="text/javascript" src="${ctx}/commons/js/common.js"></script>
	<!-- 开发国际化的引用，主要完成后台信息在前台提示的国际化，一定要放在最后 -->
	<script type="text/javascript">var ctx = '${ctx}';var actionExt = "action";var i18n = new Object();</script>
	<script src="${ctx}/commons/js/i18n/message_zh_CN.js" type="text/javascript"></script>
  </head>
  
  <body>
<%@taglib uri="http://www.framework.com/taglib/tree" prefix="tree"%>
    <div class="easyui-layout" data-options="fit:true,border:false" >
    	<div data-options="region:'north',border:false" style="padding: 4px;height: 78px;overflow: hidden;">
    		<div class="easyui-panel" data-options="fit:true,border:true" >
			<div  class="queryContent" style="height: 60px;">
				<form name="searchForm" id="searchLogForm" method="post" action="" style="display: none; " >
				<table class="queryTable" >
					<tbody>
						<tr>
							<!--  <th>操作者</th>
							<td width="10%">
							<input type="hidden" name="oper" id="oper" />
							<input class="easyui-validatebox" readonly="readonly" id="operName" type="text" name="operName" maxlength="20" style="width:120px"></input>
							<a href="javascript:void(0);" onclick="selectUsers()"><img src="${ctx}/commons/themes/icons/person.png" title="绑定人员" border="0" /></a></td>-->
							<th>操作时间</th>
							<td width="10%">
							<input id="startTime" class="easyui-datetimebox" type="text" name="startTime" data-options="validType:['dateTimeLessCompare[\'endTime\']']" maxlength="20" style="width:140px"/>-<input id="endTime" class="easyui-datetimebox" type="text" data-options="validType:['dateTimeMoreCompare[\'startTime\']']" name="endTime" maxlength="20" style="width:140px"/></td>
							<th>操作类型</th>
							<td width="10%">
							<select class="easyui-combobox" name="opType" style="width:80px;" data-options="panelHeight:120">
							<option value="-1">全部</option>
							<c:forEach items="${frame:dictChildren('log_op_type')}" var="type">
								<option value="${type.value }">${type.name }</option>
							</c:forEach>
							</select></td>
							</tr>
							<tr>
							<th>实体类名</th>
							<td width="10%">
							<input class="easyui-validatebox" type="text" name="opEntity" maxlength="20" style="width:120px"></input></td>
							<th>实体类ID</th>
							<td width="10%">
							<input class="easyui-validatebox" type="text" name="opId" maxlength="32" style="width:240px"></input></td>
							<th>日志内容</th>
							<td width="10%">
							<input class="easyui-validatebox" type="text" name="logContent" maxlength="30" style="width:120px"></input></td>
							<td align="right" width="10%"><a href="javascript:void(0);" class="easyui-linkbutton" id="searchLog"  plain="true">查询</a>
							<a href="javascript:void(0);" class="easyui-linkbutton" id="resetSearchLog" plain="true">清空</a></td>
						</tr>
					</tbody>
				</table>
				</form>
			</div>
			</div>
			</div>
		<div data-options="region:'center',border:false" style="padding: 4px;">
			<table id="listLogTable" class="easyui-datagrid" 
				data-options="singleSelect:false,toolbar:'#logtb',method:'post',rownumbers:true,fit:true,fitColumns:true,border:true,
					pagination:true,remoteSort:true,multiSort:true,striped:true,onLoadSuccess:function(data){$('#'+logParamObj.searchID).attr('disabled',false);},
					url:'${ctx}/framework/log/list'"}>
				<thead>
					<tr>
						<th data-options="field:'id',checkbox:true"></th>
						<th data-options="field:'operName',width:50,sortable:true,title:'操作者'" align="center"></th>
						<th data-options="field:'opTime',width:50,title:'操作时间'" align="center"></th>
						<th data-options="field:'opType',sortable:true,width:50,title:'操作类型'" align="center"></th>
						<th data-options="field:'opEntity',sortable:true,width:50,title:'操作实体类名'"></th>
						<th data-options="field:'opId',sortable:true,width:100,title:'实体类ID'"></th>
						<th data-options="field:'logContent',sortable:true,width:200,title:'日志内容',formatter:showContent"></th>
					</tr>
				</thead>
			</table>
			<div id="logtb" style="display: none;">
				<div>
					<a href="javascript:void(0);" onclick="deleteData(logParamObj);" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
				</div>
			</div>
			<div id="contentdiv"></div>
		</div>
	</div>
	<tree:userTree ctx="${ctx}" userIds="oper" userNames="operName" selectMethod="single"/>
</body>
	<script type="text/javascript">
		//初始化表格对应的js对象
		var logParamObj;
		$(function() {
			//初始化表格对象数据
			logParamObj = new initParams(
					{
						paramObjName : 'logParamObj',//表格对应的实体对象名称，好区分多个表格情况下的对象
						tableId:'listLogTable',
						searchID:'searchLog',
						resetSearchID:'resetSearchLog',
						searchFormID:'searchLogForm',
						deleteUrl:'${ctx}/framework/log/remove',
						ctx:'${ctx}'
					});
			//初始化查询
			init(logParamObj);
		});
		function selectUsers(){
			seloperUserTree($('#oper').val());
			$('#operTreeDialog').dialog('open');
		}
		
		 function showContent(val, row, index){
	    	  return '<a href="#" onclick="showDetail(\'' + row.id+ '\')">"'+row.logContent+'"</a>';	    	  
	      }
		 
		 function showDetail(id){
                $('#contentdiv').dialog({
                    title:"详细类容",  
				    iconCls:'icon-role-menu',
				    width:500,    
				    height: 500,    
				    closed:false,    
				    cache: false,    
				    href: '${ctx}/framework/log/contentPage?id='+id,
				    modal: true,
					});
                }

	</script>
  </body>
</html>